#include <stdio.h> 
#include <string> 

void send_auth_request(const std::string& channel = "channel", 
                       const std::string& cuid = "cuid",
                       const std::string& token = "token") {
    static std::string sign;
    static std::string payload;

    const int appid    = 800000002;
    const char *uri    = "/api/v1/token/verify";
    const char *appkey = "201611221803b6218321a4d35e26b91e";

    sign.clear();
    payload.clear();
    sign.reserve(1024);
    payload.reserve(1024);

    sign.append("channelid=").append(channel).append("&")
        .append("cuid=").append(cuid).append("&")
        .append("token=").append(token).append("&");

    payload.append("appid=").append(std::to_string(appid)).append("&");
    payload.append(sign);

    sign.append("appkey=").append(appkey);
    //payload.append("sign=").append(sk::md5_string(sign));
    payload.append("sign=sk::md5_string(sign)");

    printf("payload is %s\n", payload.c_str());
}

int main(int argc, char **argv) {
    send_auth_request();
    
    return 0;
}
